package com.coolingme.login;

/**
 * 未登录状态
 *
 * @author wangyue
 * @date 2020-09-26 0:33
 */
public class UnLoginState extends UserState {
    @Override
    protected void read() {
        System.out.println("已阅（前十章）");
    }

    @Override
    protected void comment(String content) {
        this.switch2Login();
        // 调用登录状态的评论
        this.context.comment(content);
    }

    /**
     * 切换为登录状态
     */
    private void switch2Login() {
        System.out.println("切换为登录状态");
        this.context.setCurrentState(AppContext.LOGIN_STATE);
    }
}
